﻿<?xml version="1.0" encoding="utf-8" ?>
<DomainDefinition>
	<ModelConnectionString>Data Source=.\SQLExpress;Initial Catalog=ReferenceSchema;Integrated Security=true;Connection Timeout=1;</ModelConnectionString>
	<ResolveLooseRelationships>false</ResolveLooseRelationships>
	<DomainNamespace>$ClientName$.$ModelName$.Business.Entities</DomainNamespace>
	<ClientName>dotNetProfessional</ClientName>
	<ModelName>ReferenceSchema</ModelName>
	<BaseEntityClass>
		<ClassName>EntityBase</ClassName>
		<Namespace>dnp.Framework.Business</Namespace>
		<Attributes>
			<!-- Role Types: None, PrimaryKey, ConcurrencyKey, CreatedBy, ModifiedBy, CreatedDate, ModifiedDate, IsValid, IsDirty-->
			<BusinessEntityAttribute Name="IsValid" AttributeRole="IsValid" />
			<BusinessEntityAttribute Name="IsDirty" AttributeRole="IsDirty" />
			<BusinessEntityAttribute Name="Key" AttributeRole="PrimaryKey" />
			<BusinessEntityAttribute Name="CreatedBy" AttributeRole="CreatedBy" />
			<BusinessEntityAttribute Name="ModifiedBy" AttributeRole="ModifiedBy" />
			<BusinessEntityAttribute Name="CreatedDate" AttributeRole="CreatedDate" />
			<BusinessEntityAttribute Name="ModifiedDate" AttributeRole="ModifiedDate" />
			<BusinessEntityAttribute Name="ConcurrencyId" AttributeRole="ConcurrencyKey" />
		</Attributes>
	</BaseEntityClass>
	<ManyToManyRuleDefinition>
		<ManyToManyRuleDefinition SourceObjectName="CreatedBy"/>
		<ManyToManyRuleDefinition SourceObjectName="ModifiedBy"/>
		<ManyToManyRuleDefinition SourceObjectName="CreatedDate"/>
		<ManyToManyRuleDefinition SourceObjectName="ModifiedDate"/>
		<ManyToManyRuleDefinition SourceObjectName="ConcurrencyID"/>
	</ManyToManyRuleDefinition>

	<Entities>
		<EntityDefinition Name="AllDataTypes" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.AllDataTypes" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="BigInt" SourceObjectName="BigInt" Visible="true"/>
				<PropertyDefinition Name="Binary" SourceObjectName="Binary" Visible="true"/>
				<PropertyDefinition Name="Bit" SourceObjectName="Bit" Visible="true"/>
				<PropertyDefinition Name="Char" SourceObjectName="Char" Visible="true"/>
				<PropertyDefinition Name="DateTime" SourceObjectName="DateTime" Visible="true"/>
				<PropertyDefinition Name="Decimal" SourceObjectName="Decimal" Visible="true"/>
				<PropertyDefinition Name="Float" SourceObjectName="Float" Visible="true"/>
				<PropertyDefinition Name="Image" SourceObjectName="Image" Visible="true"/>
				<PropertyDefinition Name="Int" SourceObjectName="Int" Visible="true"/>
				<PropertyDefinition Name="Money" SourceObjectName="Money" Visible="true"/>
				<PropertyDefinition Name="Nchar" SourceObjectName="Nchar" Visible="true"/>
				<PropertyDefinition Name="Ntext" SourceObjectName="Ntext" Visible="true"/>
				<PropertyDefinition Name="Numeric" SourceObjectName="Numeric" Visible="true"/>
				<PropertyDefinition Name="Nvarchar" SourceObjectName="Nvarchar" Visible="true"/>
				<PropertyDefinition Name="NVarcharMax" SourceObjectName="NVarcharMax" Visible="true"/>
				<PropertyDefinition Name="Real" SourceObjectName="Real" Visible="true"/>
				<PropertyDefinition Name="SmallDateTime" SourceObjectName="SmallDateTime" Visible="true"/>
				<PropertyDefinition Name="SmallInt" SourceObjectName="SmallInt" Visible="true"/>
				<PropertyDefinition Name="SmallMoney" SourceObjectName="SmallMoney" Visible="true"/>
				<PropertyDefinition Name="SqlVariant" SourceObjectName="SqlVariant" Visible="true"/>
				<PropertyDefinition Name="Text" SourceObjectName="Text" Visible="false"/>
				<PropertyDefinition Name="Timestamp" SourceObjectName="Timestamp" Visible="true"/>
				<PropertyDefinition Name="TinyInt" SourceObjectName="TinyInt" Visible="true"/>
				<PropertyDefinition Name="UniqueIdentifier" SourceObjectName="UniqueIdentifier" Visible="true"/>
				<PropertyDefinition Name="VarBinary" SourceObjectName="VarBinary" Visible="true"/>
				<PropertyDefinition Name="VarBinaryMax" SourceObjectName="VarBinaryMax" Visible="true"/>
				<PropertyDefinition Name="VarChar" SourceObjectName="VarChar" Visible="true"/>
				<PropertyDefinition Name="VarCharMax" SourceObjectName="VarCharMax" Visible="true"/>
				<PropertyDefinition Name="Xml" SourceObjectName="Xml" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="Char" />
			</BusinessKeys>
			<Relationships>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Car" RelativeNamespace="Vehicle" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Car" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="CarId" SourceObjectName="CarID" Visible="true"/>
				<PropertyDefinition Name="Make" SourceObjectName="Make" Visible="true"/>
				<PropertyDefinition Name="Model" SourceObjectName="Model" Visible="true"/>
				<PropertyDefinition Name="OwnerId" SourceObjectName="OwnerID" Visible="true"/>
				<PropertyDefinition Name="PreviousOwnerId" SourceObjectName="PreviousOwnerID" Visible="true"/>
				<PropertyDefinition Name="RegistrationNumber" SourceObjectName="RegistrationNumber" Visible="true"/>
				<PropertyDefinition Name="MinFuelEconomy" SourceObjectName="MinFuelEconomy" Visible="true"/>
				<PropertyDefinition Name="MaxFuelEconomy" SourceObjectName="MaxFuelEconomy" Visible="true"/>
				<PropertyDefinition Name="AverageFuelEconomy" SourceObjectName="AverageFuelEconomy" Visible="true"/>
				<PropertyDefinition Name="DealerName" SourceObjectName="DealerName" Visible="true"/>
				<PropertyDefinition Name="DealerStateId" SourceObjectName="DealerStateID" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="Make" />
				<BusinessKeyDefinition SourceObjectName="Model" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="Owner" RelationshipType="ManyToOne" SourceObjectName="FK_Car_Person" Visible="true"/>
				<RelationshipDefinition Name="PreviousOwner" RelationshipType="ManyToOne" SourceObjectName="FK_Car_Person1" Visible="true"/>
				<RelationshipDefinition Name="DealerName" RelationshipType="ManyToOne" SourceObjectName="FK_Car_Dealer" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Country" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Country" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="CountryId" SourceObjectName="CountryID" Visible="true"/>
				<PropertyDefinition Name="CountryName" SourceObjectName="CountryName" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="CountryName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="RegionCountries" RelationshipType="OneToMany" SourceObjectName="FK_Region_Country" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Course" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Course" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="CourseId" SourceObjectName="CourseID" Visible="true"/>
				<PropertyDefinition Name="UniversityId" SourceObjectName="UniversityID" Visible="true"/>
				<PropertyDefinition Name="Name" SourceObjectName="Name" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="Name" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="University" RelationshipType="ManyToOne" SourceObjectName="FK_Course_University" Visible="true"/>
				<RelationshipDefinition Name="Students" RelationshipType="ManyToMany" SourceObjectName="FK_StudentCourseLink_Course" Visible="false"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Description" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Descriptions" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="DescriptionId" SourceObjectName="DescriptionID" Visible="true"/>
				<PropertyDefinition Name="DescriptionName" SourceObjectName="Description" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="Description" />
			</BusinessKeys>
			<Relationships>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Home" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Home" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="HomeId" SourceObjectName="HomeID" Visible="true"/>
				<PropertyDefinition Name="Address" SourceObjectName="Address" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="Address" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="PersonHomes" RelationshipType="OneToMany" SourceObjectName="FK_Person_Home" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Person" RelativeNamespace="" IsAbstract="true" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Person" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="PersonId" SourceObjectName="PersonID" Visible="true"/>
				<PropertyDefinition Name="ChristianName" SourceObjectName="FirstName" Visible="true"/>
				<PropertyDefinition Name="LastName" SourceObjectName="LastName" Visible="true"/>
				<PropertyDefinition Name="HomeId" SourceObjectName="HomeID" Visible="true"/>
				<PropertyDefinition Name="MotherId" SourceObjectName="MotherID" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="FirstName" />
				<BusinessKeyDefinition SourceObjectName="LastName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="CarOwners" RelationshipType="OneToMany" SourceObjectName="FK_Car_Person" Visible="true"/>
				<RelationshipDefinition Name="CarPreviousOwners" RelationshipType="OneToMany" SourceObjectName="FK_Car_Person1" Visible="true"/>
				<RelationshipDefinition Name="HomeAddress" RelationshipType="ManyToOne" SourceObjectName="FK_Person_Home" Visible="true"/>
				<RelationshipDefinition Name="Mother" RelationshipType="Recursive" SourceObjectName="FK_Person_Mother" Visible="true"/>
				<RelationshipDefinition Name="Children" RelationshipType="OneToMany" SourceObjectName="FK_Person_Mother1toM" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="PreviousUniversityStudent" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.PreviousStudent" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="PreviousStudentId" SourceObjectName="PreviousStudentID" Visible="true"/>
				<PropertyDefinition Name="GraduationDate" SourceObjectName="GraduationDate" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="base.FirstName" />
				<BusinessKeyDefinition SourceObjectName="base.LastName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="OneToOne" RelationshipType="OneToOne" SourceObjectName="FK_PreviousStudent_Student" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Region" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Reference" SourceObjectName="dbo.Region" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="StateId" SourceObjectName="StateID" Visible="true"/>
				<PropertyDefinition Name="CountryId" SourceObjectName="CountryID" Visible="true"/>
				<PropertyDefinition Name="RegionName" SourceObjectName="RegionName" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="RegionName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="Country" RelationshipType="ManyToOne" SourceObjectName="FK_Region_Country" Visible="true"/>
				<RelationshipDefinition Name="State" RelationshipType="ManyToOne" SourceObjectName="FK_Region_State" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="SingleTable" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.SingleTable" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="SingleTableId" SourceObjectName="SingleTableID" Visible="true"/>
				<PropertyDefinition Name="Name" SourceObjectName="Name" Visible="true"/>
				<PropertyDefinition Name="CreatedBy" SourceObjectName="CreatedBy" Visible="true"/>
				<PropertyDefinition Name="ModifiedBy" SourceObjectName="ModifiedBy" Visible="true"/>
				<PropertyDefinition Name="CreatedDate" SourceObjectName="CreatedDate" Visible="true"/>
				<PropertyDefinition Name="ModifiedDate" SourceObjectName="ModifiedDate" Visible="true"/>
				<PropertyDefinition Name="ConcurrencyId" SourceObjectName="ConcurrencyID" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="Name" />
			</BusinessKeys>
			<Relationships>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="State" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Enum" SourceObjectName="dbo.State" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="StateId" SourceObjectName="StateID" Visible="true"/>
				<PropertyDefinition Name="StateName" SourceObjectName="State" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="State" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="RegionStates" RelationshipType="OneToMany" SourceObjectName="FK_Region_State" Visible="true"/>
				<RelationshipDefinition Name="DealerStates" RelationshipType="OneToMany" SourceObjectName="FK_Dealer_State" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Student" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.Student" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="StudentId" SourceObjectName="StudentID" Visible="true"/>
				<PropertyDefinition Name="GPA" SourceObjectName="GPA" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="base.FirstName" />
				<BusinessKeyDefinition SourceObjectName="base.LastName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="OneToOne" RelationshipType="OneToOne" SourceObjectName="FK_Student_Person" Visible="true"/>
				<RelationshipDefinition Name="Courses" RelationshipType="ManyToMany" SourceObjectName="FK_StudentCourseLink_Student" Visible="true"/>
				<RelationshipDefinition Name="Universities" RelationshipType="ManyToMany" SourceObjectName="FK_University_Students_Student" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="University" RelativeNamespace="" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="dbo.University" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="UniversityId" SourceObjectName="UniversityID" Visible="true"/>
				<PropertyDefinition Name="UniversityName" SourceObjectName="UniversityName" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="UniversityName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="CourseUniversities" RelationshipType="OneToMany" SourceObjectName="FK_Course_University" Visible="true"/>
				<RelationshipDefinition Name="Students" RelationshipType="ManyToMany" SourceObjectName="FK_University_Students_University" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="Dealer" RelativeNamespace="test" IsAbstract="false" IsUpdatable="true" EntityType="Entity" SourceObjectName="test.Dealer" SourceObjectType="Table" Visible="true">
			<Properties>
				<PropertyDefinition Name="DealerName" SourceObjectName="DealerName" Visible="true"/>
				<PropertyDefinition Name="StateId" SourceObjectName="StateID" Visible="true"/>
				<PropertyDefinition Name="Contact" SourceObjectName="Contact" Visible="true"/>
			</Properties>
			<BusinessKeys>
				<BusinessKeyDefinition SourceObjectName="DealerName" />
			</BusinessKeys>
			<Relationships>
				<RelationshipDefinition Name="CarDealerNames" RelationshipType="OneToMany" SourceObjectName="FK_Car_Dealer" Visible="true"/>
				<RelationshipDefinition Name="State" RelationshipType="ManyToOne" SourceObjectName="FK_Dealer_State" Visible="true"/>
			</Relationships>
		</EntityDefinition>
		<EntityDefinition Name="v_AllDataTypes" RelativeNamespace="" SourceObjectName="dbo.v_AllDataTypes" IsAbstract="false" IsUpdatable="false" EntityType="Entity" SourceObjectType="View" Visible="true">
			<Properties>
				<PropertyDefinition Name="BigInt" SourceObjectName="BigInt" Visible="true"/>
				<PropertyDefinition Name="Binary" SourceObjectName="Binary" Visible="true"/>
				<PropertyDefinition Name="Bit" SourceObjectName="Bit" Visible="true"/>
				<PropertyDefinition Name="Char" SourceObjectName="Char" Visible="true"/>
				<PropertyDefinition Name="DateTime" SourceObjectName="DateTime" Visible="true"/>
				<PropertyDefinition Name="Decimal" SourceObjectName="Decimal" Visible="true"/>
				<PropertyDefinition Name="Float" SourceObjectName="Float" Visible="true"/>
				<PropertyDefinition Name="Image" SourceObjectName="Image" Visible="true"/>
				<PropertyDefinition Name="Int" SourceObjectName="Int" Visible="true"/>
				<PropertyDefinition Name="Money" SourceObjectName="Money" Visible="true"/>
				<PropertyDefinition Name="Nchar" SourceObjectName="Nchar" Visible="true"/>
				<PropertyDefinition Name="Ntext" SourceObjectName="Ntext" Visible="true"/>
				<PropertyDefinition Name="Numeric" SourceObjectName="Numeric" Visible="true"/>
				<PropertyDefinition Name="Nvarchar" SourceObjectName="Nvarchar" Visible="true"/>
				<PropertyDefinition Name="NVarcharMax" SourceObjectName="NVarcharMax" Visible="true"/>
				<PropertyDefinition Name="Real" SourceObjectName="Real" Visible="true"/>
				<PropertyDefinition Name="SmallDateTime" SourceObjectName="SmallDateTime" Visible="true"/>
				<PropertyDefinition Name="SmallInt" SourceObjectName="SmallInt" Visible="true"/>
				<PropertyDefinition Name="SmallMoney" SourceObjectName="SmallMoney" Visible="true"/>
				<PropertyDefinition Name="SqlVariant" SourceObjectName="SqlVariant" Visible="true"/>
				<PropertyDefinition Name="Text" SourceObjectName="Text" Visible="true"/>
				<PropertyDefinition Name="Timestamp" SourceObjectName="Timestamp" Visible="true"/>
				<PropertyDefinition Name="TinyInt" SourceObjectName="TinyInt" Visible="true"/>
				<PropertyDefinition Name="UniqueIdentifier" SourceObjectName="UniqueIdentifier" Visible="true"/>
				<PropertyDefinition Name="VarBinary" SourceObjectName="VarBinary" Visible="true"/>
				<PropertyDefinition Name="VarBinaryMax" SourceObjectName="VarBinaryMax" Visible="true"/>
				<PropertyDefinition Name="VarChar" SourceObjectName="VarChar" Visible="true"/>
				<PropertyDefinition Name="VarCharMax" SourceObjectName="VarCharMax" Visible="true"/>
				<PropertyDefinition Name="Xml" SourceObjectName="Xml" Visible="true"/>
			</Properties>
		</EntityDefinition>
		<EntityDefinition Name="v_Course" RelativeNamespace="" SourceObjectName="dbo.v_Course" IsAbstract="false" IsUpdatable="false" EntityType="Entity" SourceObjectType="View" Visible="true">
			<Properties>
				<PropertyDefinition Name="CourseId" SourceObjectName="CourseID" Visible="true"/>
				<PropertyDefinition Name="Name" SourceObjectName="Name" Visible="true"/>
			</Properties>
		</EntityDefinition>
		<EntityDefinition Name="v_CourseStudentCount" RelativeNamespace="" SourceObjectName="dbo.v_CourseStudentCount" IsAbstract="false" IsUpdatable="false" EntityType="Entity" SourceObjectType="View" Visible="true">
			<Properties>
				<PropertyDefinition Name="Name" SourceObjectName="Name" Visible="true"/>
				<PropertyDefinition Name="NoStudents" SourceObjectName="NoStudents" Visible="true"/>
			</Properties>
		</EntityDefinition>
		<EntityDefinition Name="CourseStudent" RelativeNamespace="" SourceObjectName="dbo.v_CourseStudents" IsAbstract="false" IsUpdatable="false" EntityType="Entity" SourceObjectType="View" Visible="true">
			<Properties>
				<PropertyDefinition Name="Name" SourceObjectName="Name" Visible="true"/>
				<PropertyDefinition Name="CourseId" SourceObjectName="CourseID" Visible="true"/>
				<PropertyDefinition Name="FirstName" SourceObjectName="FirstName" Visible="true"/>
				<PropertyDefinition Name="LastName" SourceObjectName="LastName" Visible="true"/>
			</Properties>
		</EntityDefinition>
	</Entities>
</DomainDefinition>
